import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
Vue.config.productionTip = false

//配置axios
// import axios from '@/utils/request';
// Vue.prototype.$axios = axios;

//配置elementUI的环境
import ELEMENT from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ELEMENT); //引入内容\




import VueQuillEditor from 'vue-quill-editor'

// require styles
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

Vue.use(VueQuillEditor)

//拦截器的定义
router.beforeEach((to, from, next) => {
    if (to.path !== "/") {
        //获取token值
        let token = localStorage.getItem("token");
        //判断token值，token值如果为空
        if (token == null) {
            //跳转到登陆页面去
            next("/");
        }
    }
    next()
        //先使用next()

})

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')